#!/usr/bin/env python
# encoding: utf-8
'''
@author: zhaowenpeng
@contact: winston@peipeiyun.com
@software: garner
@file: pandas_group.py
@time: 2020/8/12 4:40 下午
@desc:
'''

import pandas as pd
data = []
df = pd.read_csv('car_market_name_all.csv')
print(df.head(10))
order = ['品牌','车厂','车系','排量','年款']
df = df[order]
df.sort_values(by=['品牌','车厂'],inplace=True)
df.set_index(['品牌','车厂'],inplace=True)
df.to_excel('car_market.xlsx')